import {post} from '@/http/request'

export type LoginRequest = {
    username: string,
    password: string
}

export type LoginReponse = {
    username:string,
    roles: string[],
    accessToken:string
}

export type reLoginRequest = {
    accessToken: string
}

// 定义的登录接口
export const userLogin = async(data?:LoginRequest) => {
    return post<LoginReponse>({},"/login",data)
} 
// 定义的刷新接口
export const refreshUserInfo = async(data?:reLoginRequest) => {
    return post<LoginReponse>({},"/getUserInfo",data)
} 